package random

import "strconv"

type RandomResStr string

func (R RandomResStr) ToInt() int {
	if len(R) <= 0 {
		return -1
	}
	resInt, err := strconv.Atoi(string(R))
	if err != nil {
		return -1
	}
	return resInt
}

func (R RandomResStr) ToString() string {
	if len(R) < 0 {
		return ""
	}
	return string(R)
}

func (R RandomResStr) Compare(another RandomResStr) bool {
	return R.ToString() == another.ToString()
}
